package fr.greta.centre.metier;

import java.util.ArrayList;
import java.util.List;

public class Candidat extends Personne {

	private String pwd;
	private List<Candidature> candidatures;
	
	
	public Candidat() {
		super();
		candidatures = new ArrayList<Candidature>();
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((pwd == null) ? 0 : pwd.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Candidat other = (Candidat) obj;
		if (pwd == null) {
			if (other.pwd != null)
				return false;
		} else if (!pwd.equals(other.pwd))
			return false;
		return super.equals(obj);
	}

	public Candidat(int idPersonne, String nom, String prenom,
			String telephone, String eMail, String ville, String adresse,String cp,String pwd, List<Candidature> lesCandidatures) {
		super(idPersonne, nom, prenom, telephone, eMail, cp, ville, adresse);
		this.pwd = pwd;
		this.candidatures = lesCandidatures;
		
	}
	public Candidat(int idPersonne, String nom, String prenom,
			String telephone, String eMail, String ville, String adresse,String cp,String pwd) {
		super(idPersonne, nom, prenom, telephone, eMail, cp, ville, adresse);
		this.pwd = pwd;
		
	}


	public Candidat(String pwd, List<Candidature> lesCandidatures) {
		super();
		this.pwd = pwd;
		this.candidatures = lesCandidatures;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public List<Candidature> getLesCandidatures() {
		return candidatures;
	}

	public void setLesCandidatures(List<Candidature> lesCandidatures) {
		this.candidatures = lesCandidatures;
	}

	@Override
	public String toString() {
		return super.toString()+" Candidat [pwd=" + pwd + ", candidatures=" + candidatures + "]";
	}
	
	
	
	
	
}
